// 全局路由守卫
import router from "./router/index";

router.beforeEach((to, from, next) => {
  const token = localStorage.getItem('token')
  // 这样直接在网址写`/home`就无法进入系统
  if(to.name !== 'login' && !token) next({ name:'login' })
  else next()
})




